// pages/another/scroll-x/index.js
import host from "../../../utils/config"
import wxapi from "../../../utils/wxapi"
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info:[],
    isRefresh: false,

    currentTab: 0,
    tabList: [
      {
        name: '招生简章',
        id: 1
      },
      {
        name: '招生目录',
        id: 2
      },
      {
        name: '参考书目',
        id: 3
      },
      {
        name: '研究生院',
        id: 4
      },
      {
        name: '分数线',
        id: 5
      }
  ]

  },

  tabNav(e) {
    let currentTab = e.currentTarget.dataset.index
    this.setData({
      currentTab
    })
  },
  handleSwiper(e) {
    let {current,source} = e.detail
    if (source === 'autoplay' || source === 'touch') {
      const currentTab = current
      this.setData({
        currentTab
      })
    }
  },
  handleTolower(e){
    wx.showToast({
      title: '到底啦'
    })
  },
  refresherpulling() {
    wx.showLoading({
      title: '刷新中'
    })
    setTimeout(() => {
      this.setData({
        isRefresh: false
      })
      wx.showToast({
        title: '加载完成'
      })
    }, 1500)
  },
  onLoad: async function (options) {
    let b=options.schoolid;
    let a = await wxapi.request(host+"jqquery.php",{table:"university",valuename:"id",value:b});
    this.setData({
      info:a.data.dataList
  })
  console.log(this.data);
  if(this.data.info[0].school_name!=null){
    wx.setNavigationBarTitle({
      　　　　title: this.data.info[0].school_name
      　　})
  }
  },
  

  onShow: function () {

  },

 
})
